package com.sjz.controller;

import com.sjz.entity.User;
import com.sjz.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    //@Autowired
    // private JdbcConfig jdbcConfig;

     //@Autowired
    // private JdbcProperties jdbcProperties;

    @Autowired
    private UserService userService;

    @GetMapping("hello")
    public String hello(){
        return "hello, spring boot!";
    }

    @GetMapping("/getUSer")
    public User getUSer() {
        User user = this.userService.queryById(19L);
        return user;
    }

    @GetMapping("/getAllUSer")
    public List<User> getAllUSer() {
        return  this.userService.getAllUser();
    }

}
